﻿<div class="easyui-layout" data-options="fit: true">
    <div data-options="region:'north',border: false,split:true" style="height:50px;">
        <div class="data-tools clearfix">
            <div class="pull-left form-inline ">
            </div>
            <div class="pull-right">
                <form class="form-inline" id="formSearch">
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">排：</label>
                        <input class="form-control wd75" name="pai" type="text" autocomplete="off">
                    </div>
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">列：</label>
                        <input class="form-control wd75" name="lie" type="text" autocomplete="off">
                    </div>
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">层：</label>
                        <input class="form-control wd75" name="ceng" type="text" autocomplete="off">
                    </div>
                    <button type="button" class="btn btn-default btn-sm active" id="btnSearch"><span class="glyphicon glyphicon-search"></span> 搜索</button>
                </form>
            </div>
        </div>
    </div>
    <div data-options="region: 'center',  border: false">
        <table id="commonWarehouseUnitDG"></table>
    </div>
</div>
<script type="text/javascript">
    //定义datagrid
    var commonWarehouseUnitDG = $("#commonWarehouseUnitDG");

    $(function() {
        Topro.UI.DataGrid(commonWarehouseUnitDG, {
            fit: true,
            method: "get",
            url: "@Url.Action("WarehouseUnitQuery", "Module")",
            queryParams: {},
            idField: 'id',
            remoteSort: false,
            multiSort: false,
            pagination: true,
            singleSelect: true, //是否支持单选
            rownumbers: true,   //行号
            frozenColumns: [
                [
                    { field: 'ck', checkbox: true }
                ]
            ],
            columns: [
                [
                    {
                        field: 'barCode',
                        title: '条码',
                        width: 150,
                        formatter: function(value, row, index) {
                            return "{0}-{1}-{2}".format(row.pai, row.lie, row.ceng,);
                        }
                    },
                    {
                        field: 'pai',
                        title: '排',
                        width: 75,
                        align: 'center'
                    },
                    {
                        field: 'lie',
                        title: '行',
                        width: 75,
                        align: 'center'
                    },
                    {
                        field: 'ceng',
                        title: '列',
                        width: 75,
                        align: 'center'
                    },
                    {
                        field: 'remark',
                        title: '备注',
                        width: 150,
                        align: 'center',
                        formatter: function(value, row, index) {
                            return "";
                        }
                    }
                ]
            ],
            rowTooltip: false
        });
        //单选隐藏
        if (window.top._isSingle) {
            $(".datagrid-header-check input[type='checkbox']").css('display', 'none');
        }
    });
</script>
